package com.wm.homework04;

public class Warrior implements Fightable{
    private int experience;
    private int blood;

    public Warrior() {
    }

    public Warrior(int experience, int blood) {
        this.experience = experience;
        this.blood = blood;
    }

    public int getExperience() {
        return experience;
    }

    public void setExperience(int experience) {
        this.experience = experience;
    }

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }

    @Override
    public void win() {
        this.experience += 10;
        System.out.println("经验值增加10,总经验值为:" + this.experience);
    }

    @Override
    public int injure(int x) {
        int blood = this.getBlood() - x;
        if (blood < MAX){
            System.out.println("血液值不足,危险!");
        }
        return blood;
    }


}
